<script setup>
import { Refresh } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router';
const router = useRouter();

const goToDetail = (id) => {
  router.push({ name: 'Detail', params: { id } });
};
</script>

<template>
  <div class="service">
    <div class="left-service">
  <div class="under1-list">
    <ul>
      <li>
        <div class="list-left">
          <div class="list-left-img">
            <img src="@/assets/images/2.jpg" alt="">
          </div>
          <div class="list-left-title">
            <div class="list-left-titlename">
              <h4>盲人按摩</h4>
            </div>
            <div class="list-left-main">
              <p>专业按摩，推拿，刮痧</p>
            </div>
          </div>
          <div class="button">
          <el-button type="primary" @click="goToDetail(1)">查看详细</el-button>
            </div>
        </div>

          </li>
    </ul>
  </div>
  <div class="under1-list">
    <ul>
      <li>
        <div class="list-left">
          <div class="list-left-img">
            <img src="@/assets/images/1.jpg" alt="">
          </div>
          <div class="list-left-title">
            <div class="list-left-titlename">
              <h4>盲人按摩</h4>
            </div>
            <div class="list-left-main">
              <p>专业按摩，推拿，刮痧</p>
            </div>
          </div>
          <div class="button">
            <el-button type="primary">查看详细</el-button>
          </div>
        </div>

      </li>
    </ul>
  </div>
  <div class="under1-list">
    <ul>
      <li>
        <div class="list-left">
          <div class="list-left-img">
            <img src="@/assets/images/3.jpg" alt="">
          </div>
          <div class="list-left-title">
            <div class="list-left-titlename">
              <h4>盲人按摩</h4>
            </div>
            <div class="list-left-main">
              <p>专业按摩，推拿，刮痧</p>
            </div>
          </div>
          <div class="button">
            <el-button type="primary">查看详细</el-button>
          </div>
        </div>

      </li>
    </ul>
  </div>
  <div class="under1-list">
    <ul>
      <li>
        <div class="list-left">
          <div class="list-left-img">
            <img src="@/assets/images/4.jpg" alt="">
          </div>
          <div class="list-left-title">
            <div class="list-left-titlename">
              <h4>盲人按摩</h4>
            </div>
            <div class="list-left-main">
              <p>专业按摩，推拿，刮痧</p>
            </div>
          </div>
          <div class="button">
            <el-button type="primary">查看详细</el-button>
          </div>
        </div>

      </li>
    </ul>
  </div>
    </div>
    <div class="right-service">

      <div class="refresh" style="display: flex;width: 200px;" @click="handleRefresh">
       <div style="font-size: 25px;">热门推荐</div>
     <el-icon  :style="{ fontSize: '36px' }"><Refresh /></el-icon>
        </div>
      <div class="under2-list">
        <ul>
          <li>
            <div class="list-right">
              <div class="list-right-img">
                <img src="@/assets/images/4.jpg" alt="">
              </div>
              <div class="list-right-title">
                <div class="list-right-titlename">
                  <h4>盲人按摩</h4>
                </div>
                <div class="list-right-main">
                  <p>专业按摩，推拿，刮痧</p>
                </div>
              </div>
            </div>

          </li>
        </ul>
      </div>
      <div class="under2-list">
        <ul>
          <li>
            <div class="list-right">
              <div class="list-right-img">
                <img src="@/assets/images/3.jpg" alt="">
              </div>
              <div class="list-right-title">
                <div class="list-right-titlename">
                  <h4>盲人按摩</h4>
                </div>
                <div class="list-right-main">
                  <p>专业按摩，推拿，刮痧</p>
                </div>
              </div>
            </div>

          </li>
        </ul>
      </div>
      <div class="under2-list">
        <ul>
          <li>
            <div class="list-right">
              <div class="list-right-img">
                <img src="@/assets/images/2.jpg" alt="">
              </div>
              <div class="list-right-title">
                <div class="list-right-titlename">
                  <h4>盲人按摩</h4>
                </div>
                <div class="list-right-main">
                  <p>专业按摩，推拿，刮痧</p>
                </div>
              </div>
            </div>

          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<style scoped>
.service{
  display: flex;
  width: 100%;

}
.under1-list ul li{
  display: flex;
  padding: 10px;
  margin-bottom: 10px;
  width: 1000px;
}
.under2-list ul li{
  display: flex;
  flex-direction: column; /* 垂直排列 */
  align-items: flex-start; /* 可选：调整子元素的对齐方式 */
  padding: 10px;
  margin-bottom: 10px;
  width: 1000px;
}
.list-left{
  flex: 1;
  display: flex;

}
.list-right{
  flex: 1;
  display: flex;
  flex-direction: column; /* 垂直排列 */
  border-left: 1px solid;
}
.list-left-img img{
width: 350px;
  height: 200px;
  padding-left: 50px;

}
.list-left-title{

  margin-left: 10px;
  flex-direction: column
}
.list-right-img img{
width: 300px;
  height: 200px;
  padding-left: 50px;

}
.refresh{
  height: 50px;
  width: 50px;
  cursor: pointer; /* 鼠标悬停时显示手型光标 */
  margin-left: 50px;
}
.list-left {
  flex: 1;
  position: relative; /* 设置相对定位 */
}

.right-service {
  flex: 1;
  position: relative; /* 设置相对定位 */
}

.button {
  position: absolute; /* 设置绝对定位 */
  bottom: 20px; /* 距离底部20px */
  right: 20px; /* 距离右侧20px */
}

</style>